package com.citycloud.ccuap.tc.admin.sec.secuser;

import com.citycloud.ccuap.commons.json.TreeNode;
import com.citycloud.ccuap.commons.sys.entity.SysGroup;
import com.citycloud.ccuap.commons.sys.entity.SysProject;
import com.citycloud.ccuap.commons.sys.entity.SysRole;
import com.citycloud.ccuap.commons.sys.entity.SysUser;
import com.citycloud.ccuap.tc.admin.entity.SysDeptmentMerge;
import com.citycloud.ccuap.tc.admin.entity.TableCateDto;
import com.citycloud.ccuap.tc.admin.model.SecUser;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface ISecUserService {

    /**
     * 获取某机构下拥有指定角色的用户
     */
     List<SecUser> getUsersInRoles(String deptId, String projectId, String roleId);

    /**
     * 获取指定用户信息
     */
     SecUser getUser(String userId, String projectId);

    /**
     * 获取当前用户信息--->当前用户Id等信息由客户端传来，如何判断当前用户在客户端做判断，cuap只做查询用户信息
     */
     SecUser getCurrentUser(String userId, String projectId);

    /**
     * 验证用户是否有指定角色
     */
     boolean hasRole(String userId, String projectId, String roleId);

    /**
     * 验证用户是否拥有角色列表中的至少一个
     */
     boolean hasRoles(String userId, String projectId, List<String> roleIds);

    /**
     * 验证用户是否拥有角色列表中的所有角色
     */
     boolean hasAllRoles(String userId, String projectId, List<String> roleIds);

	List<SysRole> findProjectRoles(String projectId, String userId);

	List<SysUser> getUsersByUserName(String userName);

	List<SysUser> getUsersByRoleId(Long roleId);

	List<SysRole> getRolesByProjectId(Long projectId);

	List<TreeNode> findProjectTreeNodesByRoles(String projectId, String roleIds, String pid);

    Set<String> findProjectFunsSetByUserIdandProjectId(Long projectId, Long userId);

    List<Map<String, Object>> getSysProjectsByConditions(Long managerId, Long cateId, String name);

	Map<String, Object> getManagersByProjectId(Long projectId);

	List<TreeNode>  findNextChildNodeTree(Long pid, boolean isAll);

	List<SysProject> getProjectsByUserRoles(Long userId);

    List<SysProject> getAllProjects();

	List<Map<String, Object>> getDeptTree(String guid, String type, int deep);

	void clearCache(String userId, String projectId);

	void clearAllCache(String userId, String projectId);

    List<Map<String, Object>> getWebSitesByRoleIdAndUserId(String userId, String roleCode);

	void clearCacheDatagroupIdAndProjectId(String datagroupId);

    List<SysProject> selectAllProjectByUserId(String userId);

    List<TableCateDto> getTablePermissionsByUser(String userId, String projectId, String cateId);

    List<SysUser> getManageUserByProjectId(String projectId);

    List<SysDeptmentMerge> getDeptmentsByPid(Long pid, boolean refrshCache);

    List<Map<String, Object>> getUsersByDeptId(Long deptId, boolean refrshCache);
    
    List<SysGroup> getAllCustomCode(String oriCustom);
    
    List<SysGroup> findByGroupNo(String groupNo);

    List<TableCateDto> getTablePermissionsByUserNew(String userId, String projectId);
}
